import request from "@/utils/request";

// 查询供应信息列表
export function listSupply(query) {
  return request({
    url: "/supply/list",
    method: "get",
    params: query,
  });
}

// 查询供应信息详细
export function getSupply(supplyId) {
  return request({
    url: "/supply/" + supplyId,
    method: "get",
  });
}

// 新增供应信息
export function addSupply(data) {
  return request({
    url: "/supply",
    method: "post",
    data: data,
  });
}

// 修改供应信息
export function updateSupply(data) {
  return request({
    url: "/supply",
    method: "put",
    data: data,
  });
}

// 删除供应信息
export function delSupply(supplyId) {
  return request({
    url: "/supply/" + supplyId,
    method: "delete",
  });
}

export function toggleSupply(data) {
  return request({
    url: "/supply/updateStatus",
    method: "put",
    data,
  });
}

export function toggleSupplyIsTop(data) {
  return request({
    url: "/supply/updateRecommendStatus",
    method: "put",
    data,
  });
}
